<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>common_util: src/common_util/sysutil.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">common_util<span id="projectnumber">&#160;1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_2961cad218251a7c35c6867350b80887.html">common_util</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">sysutil.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Common system utilities.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
</div>
<p><a href="sysutil_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:aecaf674e04f64f60fd66feab407c606d" id="r_aecaf674e04f64f60fd66feab407c606d"><td class="memItemLeft" align="right" valign="top">enum class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606d">cutl::endian</a> { <a class="el" href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606daaae6635e044ac56046b2893a529b5114">little</a>
, <a class="el" href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606dad861877da56b8b4ceb35c8cbfdf65bb4">big</a>
 }</td></tr>
<tr class="memdesc:aecaf674e04f64f60fd66feab407c606d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Endianness type.  <a href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606d">More...</a><br /></td></tr>
<tr class="separator:aecaf674e04f64f60fd66feab407c606d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74208522103f8b280572279e56105242" id="r_a74208522103f8b280572279e56105242"><td class="memItemLeft" align="right" valign="top">enum class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242">cutl::os_platform</a> { <br />
&#160;&#160;<a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242a4c7cfa22ccbb49a0418d12bdb8694bfb">os_windows</a>
, <a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242a776a1d886fdbbb04b1a8764fd3d41c9e">os_macos</a>
, <a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242aaf0e42c7c50c918d4570544ca7fad65f">os_linux</a>
, <a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242a0f8ec0e3af19b871d9014e5109e5072a">os_unix</a>
, <br />
&#160;&#160;<a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242ab6363d75c866dbc9675af5f48ebc1fcc">os_unknown</a>
<br />
 }</td></tr>
<tr class="memdesc:a74208522103f8b280572279e56105242"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operating system platform type.  <a href="sysutil_8h.html#a74208522103f8b280572279e56105242">More...</a><br /></td></tr>
<tr class="separator:a74208522103f8b280572279e56105242"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a19eb0a17bd5a89ecbbf7c5d267923402" id="r_a19eb0a17bd5a89ecbbf7c5d267923402"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242">os_platform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a19eb0a17bd5a89ecbbf7c5d267923402">cutl::platform_type</a> ()</td></tr>
<tr class="memdesc:a19eb0a17bd5a89ecbbf7c5d267923402"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the platform type for the current operating system.  <br /></td></tr>
<tr class="separator:a19eb0a17bd5a89ecbbf7c5d267923402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa39de7789fd275dec468bf2543f9c38e" id="r_aa39de7789fd275dec468bf2543f9c38e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#aa39de7789fd275dec468bf2543f9c38e">cutl::architecture</a> ()</td></tr>
<tr class="memdesc:aa39de7789fd275dec468bf2543f9c38e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the architecture of the cpu processor(or operating system).  <br /></td></tr>
<tr class="separator:aa39de7789fd275dec468bf2543f9c38e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0802ffda04848c6b280585dd1074c9df" id="r_a0802ffda04848c6b280585dd1074c9df"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a0802ffda04848c6b280585dd1074c9df">cutl::platform_name</a> (<a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242">os_platform</a> type)</td></tr>
<tr class="memdesc:a0802ffda04848c6b280585dd1074c9df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the platform name for the current operating system.  <br /></td></tr>
<tr class="separator:a0802ffda04848c6b280585dd1074c9df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a259f8f05fd841bc3c0c225e0c3936fae" id="r_a259f8f05fd841bc3c0c225e0c3936fae"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a259f8f05fd841bc3c0c225e0c3936fae">cutl::cpp_stl_version</a> ()</td></tr>
<tr class="memdesc:a259f8f05fd841bc3c0c225e0c3936fae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the C++ standard library version.  <br /></td></tr>
<tr class="separator:a259f8f05fd841bc3c0c225e0c3936fae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34a4afb93e8948c1cf525142dd1ec37" id="r_ab34a4afb93e8948c1cf525142dd1ec37"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#ab34a4afb93e8948c1cf525142dd1ec37">cutl::program_bit</a> ()</td></tr>
<tr class="memdesc:ab34a4afb93e8948c1cf525142dd1ec37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the program bit.  <br /></td></tr>
<tr class="separator:ab34a4afb93e8948c1cf525142dd1ec37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a644ae9daa2b64710b983ef767e1f10ea" id="r_a644ae9daa2b64710b983ef767e1f10ea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606d">endian</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a644ae9daa2b64710b983ef767e1f10ea">cutl::endian_type</a> ()</td></tr>
<tr class="memdesc:a644ae9daa2b64710b983ef767e1f10ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the program endianness.  <br /></td></tr>
<tr class="separator:a644ae9daa2b64710b983ef767e1f10ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96eea564b8c9916db1961f755b58829a" id="r_a96eea564b8c9916db1961f755b58829a"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a96eea564b8c9916db1961f755b58829a">cutl::byteswap</a> (uint16_t value)</td></tr>
<tr class="memdesc:a96eea564b8c9916db1961f755b58829a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Byteswap a 16-bit value.  <br /></td></tr>
<tr class="separator:a96eea564b8c9916db1961f755b58829a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cf9adcd67703aa4510e082a125f592f" id="r_a5cf9adcd67703aa4510e082a125f592f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a5cf9adcd67703aa4510e082a125f592f">cutl::byteswap</a> (uint32_t value)</td></tr>
<tr class="memdesc:a5cf9adcd67703aa4510e082a125f592f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Byteswap a 32-bit value.  <br /></td></tr>
<tr class="separator:a5cf9adcd67703aa4510e082a125f592f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8840f1db0653c00e54e802b9e17d2dd6" id="r_a8840f1db0653c00e54e802b9e17d2dd6"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a8840f1db0653c00e54e802b9e17d2dd6">cutl::byteswap</a> (uint64_t value)</td></tr>
<tr class="memdesc:a8840f1db0653c00e54e802b9e17d2dd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Byteswap a 64-bit value.  <br /></td></tr>
<tr class="separator:a8840f1db0653c00e54e802b9e17d2dd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2e3f87ac25981420fe10718a4f4276a" id="r_ad2e3f87ac25981420fe10718a4f4276a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#ad2e3f87ac25981420fe10718a4f4276a">cutl::byteswap</a> (uint8_t *data, uint32_t size)</td></tr>
<tr class="memdesc:ad2e3f87ac25981420fe10718a4f4276a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Byteswap an array of bytes.  <br /></td></tr>
<tr class="separator:ad2e3f87ac25981420fe10718a4f4276a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a200c89e4b9641fc7e73728441699397c" id="r_a200c89e4b9641fc7e73728441699397c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a200c89e4b9641fc7e73728441699397c">cutl::system</a> (const std::string &amp;cmd)</td></tr>
<tr class="memdesc:a200c89e4b9641fc7e73728441699397c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute a system command.  <br /></td></tr>
<tr class="separator:a200c89e4b9641fc7e73728441699397c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f0fd47694016b4a0904702508edf58d" id="r_a0f0fd47694016b4a0904702508edf58d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a0f0fd47694016b4a0904702508edf58d">cutl::callcmd</a> (const std::string &amp;cmd, std::string &amp;result)</td></tr>
<tr class="memdesc:a0f0fd47694016b4a0904702508edf58d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute a system command and get the output.  <br /></td></tr>
<tr class="separator:a0f0fd47694016b4a0904702508edf58d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19b7c742ba00bfbfc133ffd7d3854527" id="r_a19b7c742ba00bfbfc133ffd7d3854527"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a19b7c742ba00bfbfc133ffd7d3854527">cutl::getenv</a> (const std::string &amp;name, const std::string &amp;default_value)</td></tr>
<tr class="memdesc:a19b7c742ba00bfbfc133ffd7d3854527"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get an environment variable.  <br /></td></tr>
<tr class="separator:a19b7c742ba00bfbfc133ffd7d3854527"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae555d03fceaa9fd502210da3b84d18c5" id="r_ae555d03fceaa9fd502210da3b84d18c5"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#ae555d03fceaa9fd502210da3b84d18c5">cutl::getcwd</a> ()</td></tr>
<tr class="memdesc:ae555d03fceaa9fd502210da3b84d18c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the working directory of the current excuting process.  <br /></td></tr>
<tr class="separator:ae555d03fceaa9fd502210da3b84d18c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78f70eab68b26cda3a2a926b594b8527" id="r_a78f70eab68b26cda3a2a926b594b8527"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sysutil_8h.html#a78f70eab68b26cda3a2a926b594b8527">cutl::homedir</a> ()</td></tr>
<tr class="memdesc:a78f70eab68b26cda3a2a926b594b8527"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the home dir for the current user.  <br /></td></tr>
<tr class="separator:a78f70eab68b26cda3a2a926b594b8527"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Common system utilities. </p>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2024, Spencer.Luo. All Rights Reserved.</dd></dl>
<p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at </p><pre class="fragment">  http://www.apache.org/licenses/LICENSE-2.0
</pre><p> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations.</p>
<dl class="section author"><dt>Author</dt><dd>spencer.luo </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024-05-13 </dd></dl>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="aecaf674e04f64f60fd66feab407c606d" name="aecaf674e04f64f60fd66feab407c606d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecaf674e04f64f60fd66feab407c606d">&#9670;&#160;</a></span>endian</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum class <a class="el" href="sysutil_8h.html#aecaf674e04f64f60fd66feab407c606d">cutl::endian</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Endianness type. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aecaf674e04f64f60fd66feab407c606daaae6635e044ac56046b2893a529b5114" name="aecaf674e04f64f60fd66feab407c606daaae6635e044ac56046b2893a529b5114"></a>little&#160;</td><td class="fielddoc"><p>little endian </p>
</td></tr>
<tr><td class="fieldname"><a id="aecaf674e04f64f60fd66feab407c606dad861877da56b8b4ceb35c8cbfdf65bb4" name="aecaf674e04f64f60fd66feab407c606dad861877da56b8b4ceb35c8cbfdf65bb4"></a>big&#160;</td><td class="fielddoc"><p>big endian </p>
</td></tr>
</table>

</div>
</div>
<a id="a74208522103f8b280572279e56105242" name="a74208522103f8b280572279e56105242"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74208522103f8b280572279e56105242">&#9670;&#160;</a></span>os_platform</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum class <a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242">cutl::os_platform</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Operating system platform type. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a74208522103f8b280572279e56105242a4c7cfa22ccbb49a0418d12bdb8694bfb" name="a74208522103f8b280572279e56105242a4c7cfa22ccbb49a0418d12bdb8694bfb"></a>os_windows&#160;</td><td class="fielddoc"><p>Windows </p>
</td></tr>
<tr><td class="fieldname"><a id="a74208522103f8b280572279e56105242a776a1d886fdbbb04b1a8764fd3d41c9e" name="a74208522103f8b280572279e56105242a776a1d886fdbbb04b1a8764fd3d41c9e"></a>os_macos&#160;</td><td class="fielddoc"><p>macOS </p>
</td></tr>
<tr><td class="fieldname"><a id="a74208522103f8b280572279e56105242aaf0e42c7c50c918d4570544ca7fad65f" name="a74208522103f8b280572279e56105242aaf0e42c7c50c918d4570544ca7fad65f"></a>os_linux&#160;</td><td class="fielddoc"><p>Linux </p>
</td></tr>
<tr><td class="fieldname"><a id="a74208522103f8b280572279e56105242a0f8ec0e3af19b871d9014e5109e5072a" name="a74208522103f8b280572279e56105242a0f8ec0e3af19b871d9014e5109e5072a"></a>os_unix&#160;</td><td class="fielddoc"><p>Unix </p>
</td></tr>
<tr><td class="fieldname"><a id="a74208522103f8b280572279e56105242ab6363d75c866dbc9675af5f48ebc1fcc" name="a74208522103f8b280572279e56105242ab6363d75c866dbc9675af5f48ebc1fcc"></a>os_unknown&#160;</td><td class="fielddoc"><p>Unknown </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aa39de7789fd275dec468bf2543f9c38e" name="aa39de7789fd275dec468bf2543f9c38e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa39de7789fd275dec468bf2543f9c38e">&#9670;&#160;</a></span>architecture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::architecture </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the architecture of the cpu processor(or operating system). </p>
<dl class="section return"><dt>Returns</dt><dd>std::string the architecture. </dd></dl>

</div>
</div>
<a id="a96eea564b8c9916db1961f755b58829a" name="a96eea564b8c9916db1961f755b58829a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96eea564b8c9916db1961f755b58829a">&#9670;&#160;</a></span>byteswap() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t cutl::byteswap </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Byteswap a 16-bit value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>the value to byteswap. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint16_t the byteswapped value. </dd></dl>

</div>
</div>
<a id="a5cf9adcd67703aa4510e082a125f592f" name="a5cf9adcd67703aa4510e082a125f592f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cf9adcd67703aa4510e082a125f592f">&#9670;&#160;</a></span>byteswap() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cutl::byteswap </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Byteswap a 32-bit value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>the value to byteswap. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint32_t the byteswapped value. </dd></dl>

</div>
</div>
<a id="a8840f1db0653c00e54e802b9e17d2dd6" name="a8840f1db0653c00e54e802b9e17d2dd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8840f1db0653c00e54e802b9e17d2dd6">&#9670;&#160;</a></span>byteswap() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t cutl::byteswap </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Byteswap a 64-bit value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>the value to byteswap. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint64_t the byteswapped value. </dd></dl>

</div>
</div>
<a id="ad2e3f87ac25981420fe10718a4f4276a" name="ad2e3f87ac25981420fe10718a4f4276a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2e3f87ac25981420fe10718a4f4276a">&#9670;&#160;</a></span>byteswap() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cutl::byteswap </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Byteswap an array of bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the array of bytes to byteswap. </td></tr>
    <tr><td class="paramname">size</td><td>the size of the array. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0f0fd47694016b4a0904702508edf58d" name="a0f0fd47694016b4a0904702508edf58d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f0fd47694016b4a0904702508edf58d">&#9670;&#160;</a></span>callcmd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cutl::callcmd </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Execute a system command and get the output. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cmd</td><td>the command to be executed. </td></tr>
    <tr><td class="paramname">result</td><td>the output of the command. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the command is executed successfully, false otherwise. </dd></dl>

</div>
</div>
<a id="a259f8f05fd841bc3c0c225e0c3936fae" name="a259f8f05fd841bc3c0c225e0c3936fae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a259f8f05fd841bc3c0c225e0c3936fae">&#9670;&#160;</a></span>cpp_stl_version()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::cpp_stl_version </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the C++ standard library version. </p>
<dl class="section return"><dt>Returns</dt><dd>std::string the C++ standard library version. </dd></dl>

</div>
</div>
<a id="a644ae9daa2b64710b983ef767e1f10ea" name="a644ae9daa2b64710b983ef767e1f10ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a644ae9daa2b64710b983ef767e1f10ea">&#9670;&#160;</a></span>endian_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">endian cutl::endian_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the program endianness. </p>
<dl class="section return"><dt>Returns</dt><dd>endian the program endianness. </dd></dl>

</div>
</div>
<a id="ae555d03fceaa9fd502210da3b84d18c5" name="ae555d03fceaa9fd502210da3b84d18c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae555d03fceaa9fd502210da3b84d18c5">&#9670;&#160;</a></span>getcwd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::getcwd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the working directory of the current excuting process. </p>
<dl class="section return"><dt>Returns</dt><dd>file path of the working directory </dd></dl>

</div>
</div>
<a id="a19b7c742ba00bfbfc133ffd7d3854527" name="a19b7c742ba00bfbfc133ffd7d3854527"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19b7c742ba00bfbfc133ffd7d3854527">&#9670;&#160;</a></span>getenv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::getenv </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>default_value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get an environment variable. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of the environment variable. </td></tr>
    <tr><td class="paramname">default_value</td><td>the default value if the variable is not found. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::string the value of the environment variable. </dd></dl>

</div>
</div>
<a id="a78f70eab68b26cda3a2a926b594b8527" name="a78f70eab68b26cda3a2a926b594b8527"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78f70eab68b26cda3a2a926b594b8527">&#9670;&#160;</a></span>homedir()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::homedir </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the home dir for the current user. </p>
<dl class="section return"><dt>Returns</dt><dd>std::string the home directory. </dd></dl>

</div>
</div>
<a id="a0802ffda04848c6b280585dd1074c9df" name="a0802ffda04848c6b280585dd1074c9df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0802ffda04848c6b280585dd1074c9df">&#9670;&#160;</a></span>platform_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string cutl::platform_name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="sysutil_8h.html#a74208522103f8b280572279e56105242">os_platform</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the platform name for the current operating system. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the operating system platform type.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::string the platform name. </dd></dl>

</div>
</div>
<a id="a19eb0a17bd5a89ecbbf7c5d267923402" name="a19eb0a17bd5a89ecbbf7c5d267923402"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19eb0a17bd5a89ecbbf7c5d267923402">&#9670;&#160;</a></span>platform_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">os_platform cutl::platform_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the platform type for the current operating system. </p>
<dl class="section return"><dt>Returns</dt><dd>platform The operating system platform type. </dd></dl>

</div>
</div>
<a id="ab34a4afb93e8948c1cf525142dd1ec37" name="ab34a4afb93e8948c1cf525142dd1ec37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab34a4afb93e8948c1cf525142dd1ec37">&#9670;&#160;</a></span>program_bit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t cutl::program_bit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the program bit. </p>
<dl class="section return"><dt>Returns</dt><dd>uint16_t the program bit. </dd></dl>

</div>
</div>
<a id="a200c89e4b9641fc7e73728441699397c" name="a200c89e4b9641fc7e73728441699397c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a200c89e4b9641fc7e73728441699397c">&#9670;&#160;</a></span>system()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cutl::system </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>cmd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Execute a system command. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cmd</td><td>the command to be executed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the command is executed successfully, false otherwise. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
